#pragma once
#include <windows.h>
#include <d3d11.h>
#include <d3dx11.h>
#include <d3dcompiler.h>
#include <xnamath.h>
#include <D3DVoxelChunk.h>
HRESULT CompileShaderFromFile( WCHAR* szFileName, LPCSTR szEntryPoint, LPCSTR szShaderModel, ID3DBlob** ppBlobOut );
class D3DVoxelTechniqueOne
{
public:
	ID3D11Device*                        m_pDevice; 
	ID3D11DeviceContext*                 m_pImmediateContext;

	ID3D11VertexShader*                  m_pVertexShaderMC;
	ID3D11GeometryShader*                m_pGeometryShaderMC;

	ID3D11VertexShader*                  m_pVertexShader;
	ID3D11PixelShader*                   m_pPixelShader;

	ID3D11InputLayout*                   m_pVertexLayout;
	ID3D11InputLayout*                   m_pVoxelMeshLayout;

	ID3D11ShaderResourceView *           m_pVoxelTextureSRV;
	ID3D11SamplerState*                  m_pVoxelSamplerLinear;

	ID3D11Buffer*                        m_pVertexBuffer;
	ID3D11Buffer*                        m_pIndexBuffer;

	ID3D11ShaderResourceView*            m_pTextureRV;
	ID3D11SamplerState*                  m_pSamplerLinear;


public:
	D3DVoxelTechniqueOne(ID3D11Device *, ID3D11DeviceContext *);
	// initializes vertex, geometry, pixel shaders
	virtual HRESULT InitMCShaders();
	virtual HRESULT InitRegularShaders();
	virtual HRESULT InitSharedBuffers();
	virtual HRESULT Render(D3DVoxelChunk * , ID3D11Buffer *, ID3D11Buffer *, ID3D11Buffer *);
	virtual HRESULT ComputeIsosurface(D3DVoxelChunk * );

	virtual void Release(void);

	

};
